package com.baimifan.renovation.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.baimifan.renovation.publicfrag.Address2Fragment;
import com.baimifan.renovation.publicfrag.AddressFragment;

/**
 * Created by baimifan on 2017/07/06.
 */

public class AddressFragAdapter extends FragmentPagerAdapter {
    private String[] titles =  {"选择省", "选择市"};
    public AddressFragAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 0) {
            return new AddressFragment();
        } else {

            return new Address2Fragment();
        }
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
